All Questions
2 questions
10votes
5answers
7kviews
Using parameter substitution on a Bash array
I have file.txt that I need to read into a Bash array. Then I need to remove spaces, double quotes and all but the first comma in every entry. Here's how far I've gotten: $ cat file.txt 10,this 2 0 ...
13votes
2answers
23kviews
Count number of elements in bash array, where the name of the array is dynamic (i.e. stored in a variable)
Brief statement of the question: Is there built-in bash method to count number of elements in bash array, where the name of the array is dynamic (i.e. stored in a variable), without resorting to ...